tools: More accurate parsing of pci config.
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 19 Mar 2008 10:21:01 +0000 (10:21 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 19 Mar 2008 10:21:01 +0000 (10:21 +0000)
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
tools/python/xen/xend/server/pciif.py
tools/python/xen/xm/create.py

index f3120e610b92f773c58e42ec0464fd10c999eeb7..e616ebfe11dd6d5f96fe16dc1c8d424fd5dbc0bb 100644 (file)
@@ -177,7 +177,7 @@ class PciController(DevController):
             pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" +
                                  r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + 
                                  r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + 
-                                 r"(?P<func>[0-9a-fA-F]{1,2})", dev_config)
+                                 r"(?P<func>[0-7]{1,2})$", dev_config)
             
             if pci_match!=None:
                 pci_dev_info = pci_match.groupdict()
index e61f4ba09ad05ea20994ed2ab8ce6c5e411c4cc1..a4e756825f50710f3e42d2fae02d646c8e269346 100644 (file)
@@ -304,7 +304,7 @@ gopts.var('disk', val='phy:DEV,VDEV,MODE[,DOM]',
 gopts.var('pci', val='BUS:DEV.FUNC',
           fn=append_value, default=[],
           use="""Add a PCI device to a domain, using given params (in hex).
-         For example 'pci=c0:02.1a'.
+         For example 'pci=c0:02.1'.
          The option may be repeated to add more than one pci device.""")
 
 gopts.var('ioports', val='FROM[-TO]',
@@ -844,7 +844,7 @@ def preprocess_pci(vals):
         pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
                 r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
                 r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \
-                r"(?P<func>[0-9a-fA-F])", pci_dev_str)
+                r"(?P<func>[0-7])$", pci_dev_str)
         if pci_match!=None:
             pci_dev_info = pci_match.groupdict('0')
             try: